package com.zy.qudadid.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.zy.lcpassenger.R;
import com.zy.qudadid.model.IntegralOther;
import com.zy.qudadid.presenter.IntegralOtherPresenter;
import com.zy.qudadid.ui.adapter.base.BaseAdapter;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by liuchao on 2017/4/10.
 */

public class IntegralOtherAdapter2 extends BaseAdapter<IntegralOtherAdapter2.ViewHolder, IntegralOther, IntegralOtherPresenter> {

    public IntegralOtherAdapter2(Context context) {
        super(context);
    }

    @Override
    public int provideItemLayoutId() {
        return R.layout.item_integralother;
    }

    @Override
    public ViewHolder createVH(ViewGroup parent, int viewType, View view) {
        return new ViewHolder(view);
    }

    @Override
    public void bindData(ViewHolder holder, int position) {
        IntegralOther item = data.get(position);

        holder.txtName.setText(item.getTitle());
        holder.txtDate.setText(item.getAddtime());
//        holder.txtIntegral.setText(item.getNum());

        holder.txtIntegral.setVisibility(View.GONE);

    }

    class ViewHolder extends RecyclerView.ViewHolder {

        @Nullable
        @Bind(R.id.txtName)
        TextView txtName;
        @Nullable
        @Bind(R.id.txtDate)
        TextView txtDate;
        @Nullable
        @Bind(R.id.txtIntegral)
        TextView txtIntegral;

        public ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }
}
